package cate.game.train.spice.msg;

import cate.common.annotation.OperationSetter;
import cate.common.table.d.GDOperation;
import cate.game.GameBody;
import cate.game.client.ClientContext;
import cate.game.client.msg.ClientMsg;
import cate.game.client.msg.MsgConfig;
import cate.game.client.msg.MsgInput;
import cate.game.client.msg.id.MsgIdBTrain;
import cate.game.res.MixRes;
import easy.java.dev.note.NoteField;

import java.util.Set;

@ClientMsg(title = "星格升级の 请求")
@OperationSetter(GDOperation.SPICE_LEVEL_UP)
public class SpiceLevelUpReq implements MsgInput {
    @NoteField(value = "需要升级的星格uid", detail = "必传")
    public String spiceUid;

    @NoteField(value = "被吞噬的非经验星格们")
    public Set<String> costUids;

    @NoteField(value = "被吞噬的经验星格们")
    public MixRes consume;

    @Override
    public void execute(GameBody game, ClientContext cc) {
        game.train.spice.levelUp(cc.getRole(), spiceUid, costUids, consume);
    }

    @Override
    public MsgConfig conf() {
        return MsgIdBTrain.SPICE_LEVEL_UP_REQ;
    }
}
